<template>
  <div class="moneyDetail">
    <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
      <el-tab-pane label="银盛" name="first" :lazy="true">
        <yinshengDetail ref="yinshengRef"></yinshengDetail>
      </el-tab-pane>
      <el-tab-pane label="易生" name="second">
        <yishengDetail ref="yishengRef"></yishengDetail>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>
// components
//api
import { yishengEntry,yishengDepositInfo } from "@/api/merchants";
import yinshengDetail from "./incomingDetailYinSheng";
import yishengDetail from "./incomingDetailYiSheng";
export default {
  components: {
    yinshengDetail,yishengDetail
  },
  props: {},
  data() {
    return {
      merchantId:'',
      activeName: "first",
      fundAccountSettleType: '', // 1为日常收款 2为存管
    };
  },
  computed: {
    
  },
  created() {
    this.merchantId = this.$route.query.merchantId;
    this.fundAccountSettleType = this.$route.query.fundAccountSettleType
  },
  methods: {
    //初始化易生进件信息(日常)
    getYishengEntry() {
      yishengEntry(this.merchantId).then((res) => {
        this.$refs.yishengRef.getApi();
      });
    },
    //初始化易生进件信息(存管)
    getYishengDepositInfo() {
      yishengDepositInfo(this.merchantId).then((res) => {
        this.$refs.yishengRef.getApi();
      });
    },
    handleClick(e) {
      if(e.index==0){
        this.$refs.yinshengRef.getApi();
      }else if(e.index==1){
        if(this.fundAccountSettleType==1){
          this.getYishengEntry()
        }else{
          this.getYishengDepositInfo()
        }
        
      }
    },
  },
};
</script>
<style lang="scss" scoped>
  .moneyDetail{
    padding: 0px 0px;
    margin: 20px;
    background: #fff;
  }
</style>
